Problem: Let $ABC$ be a  triangle with $\angle BAC = 90^\circ$.  A circle is tangent to the sides $AB$ and $AC$ at $X$ and $Y$ respectively, such that the points on the circle diametrically opposite $X$ and $Y$ both lie on the side $BC$.  Given that $AB = 6$, find the area of the portion of the circle that lies outside the triangle.

[asy]
import olympiad;
import math;
import graph;

unitsize(4cm);

pair A = (0,0);
pair B = A + right;
pair C = A + up;

pair O = (1/3, 1/3);

pair Xprime = (1/3,2/3);
pair Yprime = (2/3,1/3);

fill(Arc(O,1/3,0,90)--Xprime--Yprime--cycle,0.7*white);

draw(A--B--C--cycle);
draw(Circle(O, 1/3));
draw((0,1/3)--(2/3,1/3));
draw((1/3,0)--(1/3,2/3));

draw((1/16,0)--(1/16,1/16)--(0,1/16));

label("$A$",A, SW);
label("$B$",B, down);
label("$C$",C, left);
label("$X$",(1/3,0), down);
label("$Y$",(0,1/3), left);

[/asy]
Solution: Let $O$ be the center of the circle, and $r$ its radius, and let $X'$ and $Y'$ be the points diametrically opposite $X$ and $Y$, respectively. We have $OX' = OY' = r$, and $\angle X'OY' = 90^\circ$. Since triangles $X'OY'$ and $BAC$ are similar, we see that $AB = AC$. Let $X''$ be the foot of the altitude from $Y'$ to $\overline{AB}$. Since $X''BY'$ is similar to $ABC$, and $X''Y' = r$, we have $X''B = r$. It follows that $AB = 3r$, so $r = 2$.

[asy]

import olympiad;
import math;
import graph;

unitsize(4cm);

pair A = (0,0);
pair B = A + right;
pair C = A + up;

pair O = (1/3, 1/3);

pair Xprime = (1/3,2/3);
pair Yprime = (2/3,1/3);

fill(Arc(O,1/3,0,90)--Xprime--Yprime--cycle,0.7*white);

draw(A--B--C--cycle);
draw(Circle(O, 1/3));
draw((0,1/3)--(2/3,1/3));
draw((1/3,0)--(1/3,2/3));

draw((2/3, 0)--(2/3, 1/3));
draw((1/16,0)--(1/16,1/16)--(0,1/16));

label("$A$",A, SW);
label("$B$",B, down);
label("$C$",C, left);
label("$X$",(1/3,0), down);
label("$Y$",(0,1/3), left);
label("$X'$", (1/3, 2/3), NE);
label("$Y'$", (2/3, 1/3), NE);
label("$X''$", (2/3, 0), down);
label("$O$", O, NE);

[/asy]

Then, the desired area is the area of the quarter circle minus that of the triangle $X'OY'$. And the answer is $\frac 1 4 \pi r^2 - \frac 1 2 r^2 = \boxed{\pi - 2}$.